import server from "@/utils/request";

//获取全部用户信息
export function getUserList(data) {
    return server({
        url: '/employees/page',
        method: 'get',
        params: data
    })
}

//新增用户
export function saveUser(data) {
    return server({
        url: '/employees',
        method: 'post',
        data: data    //一般post请求，使用data属性来传参
    })
}

//修改
export function editUser(data) {
    return server({
        url: '/employees',
        method: 'put',
        data: data    //一般post请求，使用data属性来传参
    })
}

//通过用户Id获取用户信息
export function getUserById(id) {
    return server({
        url: '/employees/' + id,
        method: 'get'
    })
}

//删除
export function deleteUserById(employeesId) {
    return server({
        url: `/employees/${employeesId}`,
        method: 'delete'
    })
}